﻿
#include<stdio.h>
int solve2()
{
	int n, i, a1 = 0, k = 0, max = -1;
	double sum = 0;
	scanf("%d", &n);
	int v;
	for (i = 0; i < n; i++)
	{
		scanf("%d", &v);
		if (v % 3 == 0 && v > max)//能被K整除，且比已有max大
			max = v;
		if (v % 3 == 1)
			a1++;
		if (v % 3 == 2)
		{
			sum = sum + v;
			k++;
		}
	}
	if (max == -1)
		printf("NONE ");
	else
		printf("%d ", max);
	if (a1 == 0)
		printf("NONE ");
	else
		printf("%d ", a1);
	if (sum == 0)
		printf("NONE");
	else
		printf("%.1f", sum / k);
	return 0;
}

int main2()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-185.txt", "r", stdin);
	solve2();
	return 0;
}
